import request from '@/utils/request'

// 查询网站配置列表
export function listSiteConfig(query) {
  return request({
    url: '/cms/site/config/list',
    method: 'get',
    params: query
  })
}

// 获取网站配置详细
export function getSiteConfig(configId) {
  return request({
    url: '/cms/site/config/' + configId,
    method: 'get'
  })
}

// 新增网站配置
export function addSiteConfig(data) {
  return request({
    url: '/cms/site/config',
    method: 'post',
    data: data
  })
}

// 修改网站配置
export function updateSiteConfig(data) {
  return request({
    url: '/cms/site/config',
    method: 'put',
    data: data
  })
}

// 删除网站配置
export function delSiteConfig(configId) {
  return request({
    url: '/cms/site/config/' + configId,
    method: 'delete'
  })
}

// 根据键名获取配置
export function getConfigByKey(configKey) {
  return request({
    url: '/cms/site/config/key/' + configKey,
    method: 'get'
  })
}
